/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Eduardo
 */
@Embeddable
public class PublicacionxlocalPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "IdLocal")
    private int idLocal;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "IdPublicacion")
    private String idPublicacion;

    public PublicacionxlocalPK() {
    }

    public PublicacionxlocalPK(int idLocal, String idPublicacion) {
        this.idLocal = idLocal;
        this.idPublicacion = idPublicacion;
    }

    public int getIdLocal() {
        return idLocal;
    }

    public void setIdLocal(int idLocal) {
        this.idLocal = idLocal;
    }

    public String getIdPublicacion() {
        return idPublicacion;
    }

    public void setIdPublicacion(String idPublicacion) {
        this.idPublicacion = idPublicacion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idLocal;
        hash += (idPublicacion != null ? idPublicacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PublicacionxlocalPK)) {
            return false;
        }
        PublicacionxlocalPK other = (PublicacionxlocalPK) object;
        if (this.idLocal != other.idLocal) {
            return false;
        }
        if ((this.idPublicacion == null && other.idPublicacion != null) || (this.idPublicacion != null && !this.idPublicacion.equals(other.idPublicacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.PublicacionxlocalPK[ idLocal=" + idLocal + ", idPublicacion=" + idPublicacion + " ]";
    }
    
}
